// 重写日期程序

#include <iostream>
using namespace std;

class Date {
private:
    int year;
    int month;
    int day;

public:
    Date() {
        year = 2000;
        month = 1;
        day = 1;
    }

    Date(int year, int month, int day) {
        SetDate(year, month, day);
    }

    void SetDate(int year, int month, int day) {
        this->year = year;
        this->month = month;
        this->day = day;
    }

    void ShowDate() {
        cout << year << "/" << month << "/" << day << "\n";
    }
};

int main() {
    cout << "新版本的日期程序\n";

    Date* myDate = new Date;
    Date* yourDate = new Date(1955, 5, 5);

    cout << "旧日期是\n";
    cout << "myDate日期是: ";
    myDate->ShowDate();

    cout << "yourDate日期是: ";
    yourDate->ShowDate();

    cout << "\n下面要更改日期。\n";
    myDate->SetDate(1956, 1, 2);
    yourDate->SetDate(1994, 3, 14);

    cout << "\n新日期是\n";
    cout << "myDate日期是: ";
    myDate->ShowDate();

    cout << "yourDate日期是: ";
    yourDate->ShowDate();

    cout << "完毕\n";

    delete myDate;
    delete yourDate;
}

